package phoneBook;

import arcademis.*;
import arcademis.concreteComponents.*;
import rme.naming.*;
import rme.*;

public class Client {

	public static void main(String args[]) throws ReconfigurationException {
		RmeConfigurator conf = new RmeConfigurator();
		conf.configure();

		if(args.length < 1) {
			System.err.println("Sintaxe: java Client objName");
			System.exit(1);
		}
		else {
			try {
				PhoneCatalogue p = (PhoneCatalogue)RmeNaming.lookup(args[0]);

				PhoneAddress a = p.getPhoneAddress("Fernando Magno");
				System.out.println(a.toString());
			} catch (ArcademisException e) {
				e.printStackTrace();
			} catch (MalformedURLException e) {
				e.printStackTrace();
			} catch (NotBoundException e) {
				e.printStackTrace();
			}
		}
	}
}